/*
表格字段
 */


import {reactive} from "vue";

export const userTableColumns = [
    {
        title: 'ID主键' ,
        dataIndex: 'userId',
        key: 'userId',
    },
    {
        title: '身份',
        dataIndex: 'roleId',
        key: 'roleId',
    },
    {
        title: '账户',
        key: 'account',
        dataIndex: 'account',
    },
    {
        title:'姓名',
        key:'name',
        dataIndex:'name'
    },
    {
        title: 'Action',
        key: 'action',
    },

];
/**
 * 搜索栏目 label是输入框前面的文字，name是key，rules验证规则，
 *  rules:[{ type: 'email' }]***[{ required: true ,message:"请输入姓名"}]****[{ type: 'number', min: 0, max: 99 }]
 *  imputType:input****input-number****textarea，目前只做了input上面
 * {
 *         label:"姓名",
 *         name: 'name',
 *         rules: [{ required: true }],
 *         inputType: 'input'
 *         placeHolder:'请输入姓名',//这么可以没有，默认值为‘请输入值’
 *     },
 */
export const userSearchColumns = [
    {
        label: 'ID主键' ,
        name: 'userId',
        rules: [{ required: false }],
        inputType: 'input',
        placeHolder: "请输入ID",

    },
    {
        label: '身份',
        name: 'roleId',
        inputType: 'dropdown',
        placeHolder: '请选择身份',
        selectList: [
            {
                selectKey:"1",
                selectName: "管理员"
            },
            {
                selectKey:"2",
                selectName: "实验员"
            },
            {
                selectKey:"3",
                selectName: "老师"
            },
            {
                selectKey:"4",
                selectName: "学生"
            }
        ]

    },
    {
        label: '账户',
        name: 'account',
        rules: [{ required: false,message:"请输入ID" }],
        inputType: 'input',
        placeHolder: "请输入账户"
    },
    {
        label:'姓名',
        name:'name',
        rules: [{ required: false}],
        inputType: 'input',
        placeHolder: "请输入姓名"
    },
    // {
    //     label:'密码',
    //     name:'password',
    //     rules: [{ required: false,message:"请输入ID" }],
    //     inputType: 'input',
    //     placeHolder: "请输入密码"
    // },

];

/*
    弹窗表单字段
    rules:[{ type: 'email' }]***[{ required: true }]****[{ type: 'number', min: 0, max: 99 }]
    imputType:input****input-number****textarea
 */
const modelFormFields =reactive([
    [//technician,实验员
        {
            title:"姓名",
            key: 'name',
            rules: [{ required: true }],
            inputType: 'input'
        },
        {
            title: "账户",
            key: 'account',
            rules: [{required:true }],
            inputType: 'input'
        },
        {
            title: "职称",
            key: 'title',
            rules:  [{required:true }],
            inputType: 'input'
        }
    ],
    [//教师
        {
            title:"姓名",
            key: 'name',
            rules: [{ required: true }],
            inputType: 'input'
        },
        {
            title: "账户",
            key: 'account',
            rules: [{required:true }],
            inputType: 'input'
        },
        {
            title: "职称",
            key: 'title',
            rules:  [{required:true }],
            inputType: 'input'
        }
    ],
    [
        {
            title:"姓名",
            key: 'name',
            rules: [{ required: true }],
            inputType: 'input'
        },
        {
            title: "账户",
            key: 'account',
            rules: [{required:true }],
            inputType: 'input'
        },
        {
            title: "专业",
            key: 'major',
            rules:  [{required:true }],
            inputType: 'input'
        },
        {
            title:"班级",
            key:"classname",
            rules:  [{required:true }],
            inputType: 'input'
        }
    ]
]);







export {modelFormFields}
